package com.zzuli.yxy.util;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @auther pony
 * @create 2023-03-13 22:02
 */
public class WebUtils {
    /**
     * @param response 渲染对象
     * @param string 带渲染的字符串
     * @return null
     */
    public static String renderString(HttpServletResponse response, String string){
        try {
            response.setStatus(200);
            response.setContentType("application/json");
            response.setCharacterEncoding("utf-8");
            response.getWriter().println(string);
        }catch (IOException e){
            e.printStackTrace();
        }
        return null;
    }
}
